// pages/mine/mine_resume/mine_resume.js
import {getResume,getTag} from '../../../utils/api'
const app = getApp()
Page({
  data: {
    resume:{
    },
    icon:[
      {icon:'location-o',text:'上海市宝山区'},
      {icon:'phone-o',text:NaN},
      {icon:'envelop-o',text:'20@qq.con'}
    ],
    tag:[
      {tag:"java"},
      {tag:"javascript"},
      {tag:"python"},
      {tag:"java"}
    ],
    item:[
      {name:'i相会',time:'1999-02-12'}
    ]
  },
  /**
   * 生命周期函数--监听页面加载
   */
  getTag(){
    let that = this;
    let userId = app.globalData.userI
    getTag(userId).then((res)=>{
      console.log(res);
    })
  },
  getResume(){
    let that = this;
    let userId = app.globalData.userId
    console.log(userId);
    getResume(userId).then((res)=>{
      let educationTimeArr = res.data.educationalBackgrounds
      let projectTimerArr= res.data.projectExperiences
      // console.log(res.data);
      // console.log('start',educationTimeArr);
      for(let arr of educationTimeArr){
        arr.start = arr.start.substring(0,10)
      }
      that.setData({
        resume:res.data
      })
      // console.log('end',educationTimeArr);
    })
  },

  onLoad: function (options) {
    this.getResume()
    this.getTag()
  },
  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },
})